﻿@model IEnumerable<DeJC.DAL.Model.GeneralMiscType>

@{
    //ViewBag.Title = "GtList";
    Layout = "~/Views/Shared/_LayoutConfig.cshtml";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Create New", "GtCreate",new{pId=Request.Params["pId"]})
</p>
<table>
    <tr>
        <th>ID</th>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            Enabled
        </th>
        <th>
            Order
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>@item.ID</td>
        <td>
            @if(string.IsNullOrEmpty(Request.Params["pId"])||Request.Params["pId"]=="0") {<text>@Html.ActionLink(item.Name,"GtList",new{pId=item.ID})</text>}else
            {
                @item.Name
            }            
@*            @Html.DisplayFor(modelItem => item.Name)*@
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @item.Enabled
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Order)
        </td>
        <td>
            @Html.ActionLink("Edit", "GtEdit", new { id=item.ID }) @*|
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })*@
        </td>
    </tr>
}

</table>
